var newsclassModel = {
	getList: function(data, result, fail){
		$.ajax('/admin/newsclass/list', {
      type: 'get',
      data: data,
      dataType: 'json',
      success: result,
      error: fail
    });
	},
  getInfo: function(data, result, fail){
    $.ajax('/admin/newsclass/info', {
      type: 'get',
      data: data,
      dataType: 'json',
      beforeSend: function () {
        $("#loadingMask").fadeIn();
      },
      complete: function () {
        $("#loadingMask").fadeOut();
      },
      success: result,
      error: fail
    });
  },
  insert: function(data, result, fail){
    $.ajax('/admin/newsclass/insert', {
      type: 'post',
      data: data,
      dataType: 'json',
      beforeSend: function () {
        $("#loadingMask").fadeIn();
      },
      complete: function () {
        $("#loadingMask").fadeOut();
      },
      success: result,
      error: fail
    });
  },
  addColumn: function(data, result, fail){
    $.ajax('/admin/newsclass/add-column', {
      type: 'post',
      data: data,
      dataType: 'json',
      success: result,
      error: fail
    });
  },
	editColumn: function(data, result, fail){
		$.ajax('/admin/newsclass/edit-column', {
      type: 'post',
      data: data,
      dataType: 'json',
      success: result,
      error: fail
    });
	},
  update: function(data, result, fail){
    $.ajax('/admin/newsclass/update', {
      type: 'post',
      data: data,
      dataType: 'json',
      success: result,
      error: fail
    });
  },
  uploadPic1: function(data, result, fail){
    $.ajax('/admin/newsclass/upload-pic', {
      type: "post",
      data: data,
      dataType: 'json',
      processData: false,
      contentType: false,
      beforeSend: function () {
        $("#loadingMask").fadeIn();
      },
      complete: function () {
        $("#loadingMask").fadeOut();
      },
      success: result,
      error: fail
    });
  },
  removePic1: function(data, result, fail){
    var url = '/admin/newsclass/remove-pic1';
    $.post(url, data, result).fail(fail);   
  },
  delete: function(data, result, fail){
    var url = '/admin/newsclass/delete';
    $.post(url, data, result).fail(fail);
  },
  addPerm: function(data, result, fail){
    var url = '/admin/newspopedom/add-popedom';
    $.post(url, data, result).fail(fail);
  },
  removePerm: function(data, result, fail){
    var url = '/admin/newspopedom/remove-popedom';
    $.post(url, data, result).fail(fail);
  }
};